#ifndef CLIENT_HPP_
#	define CLIENT_HPP_


#   include "Vertex.hpp"
#   include <cstring>
#	include <iostream>



class VRPTW;

struct TimeInfo
{
	enum Status { TI_OK = 0, TI_BAD_CAPACITY, TI_BAD_TIME };
    
    TimeInfo::Status tiStatus;
	double		tiEndDate;
	double		tiWaitForOpen;
	double		tiTotalTime;
    double      tiTotalCapacity;
    bool        tiArrivalAtLastDate;    // vehicule est arrive au dernier moment
};


class Client : public Vertex
{
	public:
		Client(	const VRPTW&    inVRPTW,
                unsigned 	inId,
				double 		inX,
				double		inY,
				double		inDemand,
				double		inReadyTime,
				double		inDueDate,
				double		inServiceTime);
		
		std::string		toStr() const;
		
		//void			changeTournee(Tournee* inTournee);
        
        /*
		void			setTournee(Tournee* inTournee)
		{
			clTournee = inTournee;
		}
		
		void			clearTournee()
		{
			setTournee(0);
		}
		*/
		void			test(TimeInfo*	inTimeInfo, double inArrivalDate, double inArrivalVehicleCapacity) EXC_THROWER();

        /*
		bool			used() const
		{	return (clTournee != 0);	}
        */
        
        bool            isLocked() const
        {
            return (clLocked);
        }
        
        void            setLocked(bool inValue)
        {
            clLocked = inValue;
        }
        
        const VRPTW&        clVRPTW;
        bool                clLocked;
		const double		clDemand;
		const double 		clReadyTime;
		const double		clDueDate;
		const double		clServiceTime;
		
		//Tournee*			clTournee;
};

#endif
